package com.healthcloud.service.minio.impl;

import com.healthcloud.dao.MinioUploadDao;
import com.healthcloud.entity.MinioUpload;
import com.healthcloud.entity.MinioUploadVo;
import com.healthcloud.service.minio.MinioUploadService;
import com.healthcloud.utils.PageParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


@Service
public class MinioUploadServiceImpl implements MinioUploadService {


    @Autowired
    private MinioUploadDao minioUploadDao;

    @Transactional(rollbackFor = Exception.class)
    public void saveMinio(MinioUpload entity){

        minioUploadDao.saveMinio(entity);

    }


    /**
     * 获取存储文件列表数据
     * @param vo 查询参数
     * @param pageParam 分页参数
     * @return
     */
    @Override
    public List<MinioUpload> queryMinio(MinioUploadVo vo, PageParam pageParam) {
        return minioUploadDao.queryMinio(vo, pageParam);
    }

    /**
     * 获取存储文件记录数
     * @param vo 查询参数
     * @return
     */
    @Override
    public int countMinio(MinioUploadVo vo) {
        return minioUploadDao.countMinio(vo);
    }

    /**
     * 根据id批量删除数据
     * @param ids
     */
    @Override
    public void deleteBatch(Integer[] ids) {
        minioUploadDao.deleteBatch(ids);
    }
}
